home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
mindos11.zip
/
MSHNAME.C
< prev
Wrap
C/C++ Source or Header
|
1991-03-22
|
882b
|
37 lines
/* mshname.c -- show only name of a regular Minix file */
/* Copyright 1988,1991 Steven W. Harrold - All rights reserved. */
/* $Header: MSHNAME.C_V 1.2 91/03/19 09:58:22 SWH Exp $ */
#include <stdio.h>
#include "mfs.h"
/*==================================================================*/
void show_name (path, dp, iarea)
char *path ;
struct directory *dp ;
struct inode *iarea ;
{
int i, j, k, n ;
char c ;
if (!(n = dp->d_inum)) /*assignok*/
return ;
if (!(iarea[n].i_mode & I_REGULAR))
return ;
printf ("%s", path) ;
if (path[1])
printf ("/") ;
/* Display the unadorned filename
*/
for (i=0; (i<NAME_SIZE) && (c=dp->d_name[i]); i++) /*assignok*/
printf ("%c", c) ;
printf ("\n") ;
} /* show_name() */
/*---eof---*/